package com.study;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.XmlUtil;
import org.apache.commons.text.StringEscapeUtils;
import org.junit.jupiter.api.Test;
import org.w3c.dom.Document;

/**
 * @author zhuzi
 * 2024/3/1 10:07
 */
public class XmlSpaceDemo {

    @Test
    public void test(){
        String escapedXml = "&lt;example&gt;Hello, World!&lt;/example&gt;";
        Document document = XmlUtil.parseXml(escapedXml);

    }
    @Test
    public void  test1(){
        String escapedXml = "&lt;example&gt;Hello, World!&lt;/example&gt;";
        String s = StringEscapeUtils.unescapeXml(escapedXml);
        System.out.println(s);
    }

    @Test
    public void testy2(){
        String utf8String = FileUtil.readUtf8String("/Users/zhuzi/Downloads/123.txt");
        String s = StringEscapeUtils.unescapeXml(utf8String);
        System.out.println(s);
    }
}
